﻿using System;
using System.ComponentModel;

namespace CannedHeater.ViewModel.DataContainers
{

    /// <summary>
    /// Holds data for the status panel to display
    /// </summary>
    public class StatusPanelData : INotifyPropertyChanged
    {
        // NaN is default, to show that no data is yet known
        private double _indoorTemp = Double.NaN;
        private double _outdoorTemp = Double.NaN;
        private double _solarHeaterTemp = Double.NaN;
        private double _airFlow = Double.NaN;

        public double IndoorTemp
        {
            get { return _indoorTemp; }
            set
            {
                _indoorTemp = value;
                RaisePropertyChanged("IndoorTemp");
            }
        }

        public double OutdoorTemp
        {
            get { return _outdoorTemp; }
            set
            {
                _outdoorTemp = value;
                RaisePropertyChanged("OutdoorTemp");
            }
        }

        public double SolarHeaterTemp
        {
            get { return _solarHeaterTemp; }
            set
            {
                _solarHeaterTemp = value;
                RaisePropertyChanged("SolarHeaterTemp");
            }
        }

        public double AirFlow
        {
            get { return _airFlow; }
            set
            {
                _airFlow = value;
                RaisePropertyChanged("AirFlow");
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void RaisePropertyChanged(string prop)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(prop));
        }
    }
}
